import {
  Routes,
  Route,
  unstable_HistoryRouter as HistoryRouter,
} from 'react-router-dom'
import { history } from '@/utils'
import Layout from '@/pages/Layout'
import Login from '@/pages/login/Login'
import './App.css'
import AuthComponent from '@/components/AuthComponent'
import Home from '@/pages/home'
import Article from '@/pages/article'
import Publish from './pages/publish'
function App() {
  return (
    <>
      <HistoryRouter history={history}>
        <Routes>
          <Route
            path="/"
            element={
              <AuthComponent>
                <Layout />
              </AuthComponent>
            }>
            <Route index element={<Home />} />
            <Route path="article" element={<Article />} />
            <Route path="publish" element={<Publish />} />
          </Route>
          <Route path="/login" element={<Login />}></Route>
        </Routes>
      </HistoryRouter>
    </>
  )
}

export default App
